package com.lqd.mall.system;

import com.lqd.mall.basis.constant.ParamTypeConstants;
import com.lqd.mall.basis.response.CommonResult;
import com.lqd.mall.basis.response.Result;
import com.lqd.mall.interaction.basis.vo.TableDataInfoVo;
import com.lqd.mall.interaction.system.SysLogininforEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 零起点
 * @create 2022-02-13 12:12
 */
@RequestMapping("logininfor")
@Api(tags = "登录日志")
public interface SysLogininforControllerApi {
    /**
     * 添加登录日志
     *
     * @param sysLogininforEntity 登录日志
     * @return
     */
    @PostMapping("sava")
    @ApiOperation("添加登录日志")
    CommonResult saveLogininfor(@RequestBody SysLogininforEntity sysLogininforEntity);


    /**
     * 添加登录日志
     *
     * @param sysLogininforEntity 登录日志
     * @return
     */
    @GetMapping("list")
    @ApiOperation("查询登录日志")
    Result<TableDataInfoVo<SysLogininforEntity>> list(SysLogininforEntity sysLogininforEntity);

    @DeleteMapping("{infoId}")
    @ApiOperation("删除登录日志")
    @ApiImplicitParam(name = "infoId", value = "登录日志序号", paramType = ParamTypeConstants.PATH, required = true)
    CommonResult deleteSysLoginfoById(@PathVariable("infoId") Long infoId);

    /**
     * 清空全部日志
     * @return
     */
    @DeleteMapping("clean")
    @ApiOperation("删除全部登录日志")
    CommonResult deleteSysLoginfoAll( );

    /**
     * 导出登录日志
     * @return
     */
    @PostMapping("export")
    @ApiOperation("导出登录日志")
    void export(HttpServletResponse response, SysLogininforEntity config );
}
